package com.buric.web.admin.controller;

import com.buric.api.dto.admin.LoginAdmin;
import com.buric.common.data.R;
import com.buric.web.admin.service.AdminService;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * <p>
 * 管理员信息
 * </p>
 *
 * @author zhou.wei
 * @version 1.0
 * @since 2025/2/7 15:23
 */
@RequiredArgsConstructor
@RestController
@RequestMapping("/admin")
public class AdminController {

    private final AdminService adminService;


    @ApiOperation("通过账号获取用户信息")
    @GetMapping("/info/{username}")
    public R<LoginAdmin> getUserByUsername(@PathVariable("username") String username) {
        return R.ok(adminService.getUserByUsername(username));
    }
}
